#include "ros/ros.h"

int main(int argc, char *argv[])
{
    if(argc != 4)
    {
        // std::string s = __FILE__;
        ROS_INFO("Usage: demo4_param red green blue");
        return 1;
    }
    ros::init(argc, argv, "setParam");
    ros::NodeHandle nh("turtlesim");

    // 方式一：nh操控
    // nh.setParam("background_r", 0);
    // nh.setParam("background_g", 255);

    // 方式二：ros::param
    ros::param::set("/turtlesim/background_r", atoi(argv[1]));
    ros::param::set("/turtlesim/background_g", atoi(argv[1]));
    ros::param::set("/turtlesim/background_b", atoi(argv[1]));
    return 0;
}
